Rails.application.routes.draw do

  resources :member_card_details

  resources :member_cards do 
    get :recharge, :on=> :collection
  end

  resources :package_details

  resources :packages

  resources :payment_methods

  resources :order_beauty_parts

  resources :customer_reviews do 
     get 'record', :on => :member
  end

  resources :roles

  get 'analize/staff_achievement'
  get 'analize/business_total'
  get 'analize/maintain_income'
  get 'analize/business_income'
  get 'analize/stockin_stockout'
  get 'analize/part_salse'

  get 'service/maintain'
  get 'service/maintain_show'
  get 'service/beauty'
  get 'service/beauty_show'

  get 'users/index'
  get 'users/new'
  get 'users/edit/:id' => 'users#edit'


  resources :staffs

  resources :car_models

  resources :car_brands do 
    get :car_mo_check, :on => :collection
  end

  resources :part_salse_details

  resources :part_salses 

  get 'finance/purchase_payment'
  get 'finance/purchase_payment_pay'
  get 'finance/maintain_payment'
  get 'finance/maintain_payment_pay'
  get 'finance/beauty_payment'
  get 'finance/beauty_payment_pay'
  get 'finance/salse_payment'
  get 'finance/salse_payment_pay'

  resources :part_stockout_details

  resources :part_stockouts

  get 'inventory/index'

  resources :part_stockin_details

  resources :part_stockins

  resources :order_beauty_items
  
  resources :beauty_items

  resources :order_beauties do
    get :autocomplete_car_mo_name, :on => :collection
  end

  resources :order_maintain_parts

  resources :order_maintain_items

  resources :order_maintains do 
    get :autocomplete_car_mo_name, :on => :collection
  end

  resources :maintain_items

  resources :maintain_styles

  resources :part_purchase_details

  resources :part_purchases 

  resources :suppliers

  resources :insurers

  resources :parts

  resources :part_styles

  get 'customers/index'
  resources :customers do 
    get :customer_check, :on => :collection
  end

  get 'customer_levels/index'
  resources :customer_levels

  devise_for :users
  root 'main#index'


  mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".

  # You can have the root of your site routed with "root"
  # root 'welcome#index'

  # Example of regular route:
  #   get 'products/:id' => 'catalog#view'

  # Example of named route that can be invoked with purchase_url(id: product.id)
  #   get 'products/:id/purchase' => 'catalog#purchase', as: :purchase

  # Example resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Example resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Example resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Example resource route with more complex sub-resources:
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', on: :collection
  #     end
  #   end

  # Example resource route with concerns:
  #   concern :toggleable do
  #     post 'toggle'
  #   end
  #   resources :posts, concerns: :toggleable
  #   resources :photos, concerns: :toggleable

  # Example resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end
end
